Estimating respiratory phase from a video of a subject

ABSTRACT

A video is received of a region of a subject where a signal corresponding to respiratory function can be registered by a video device. Pixels in the region in each of the image frames are processed to identify a respiratory pattern with peak/valley pairs. A peak/valley pair of interest is selected. An array of optical flow vectors is determined between a window of groups of pixel locations in a reference image frame corresponding to a peak of the pair/valley pair and a window in each of a number of image frames corresponding to the respiratory signal between the peak and ending at a valley point. Optical flow vectors have a direction and a magnitude. A ratio is determined between upwardly pointing optical flow vectors and downwardly pointing optical flow vectors. Based on the ratio, a determination is made whether the respiration phase for that peak/valley pair is inspiration or expiration.

TECHNICAL FIELD

The present invention is directed to systems and methods for estimatingrespiratory phase from a video of a subject for respiratory functionassessment.

BACKGROUND

Respiration is an important physiological activity that helps facilitatemetabolism. Monitoring respiratory function is of great clinicalsignificance. Continuous monitoring of respiratory events is also animportant clinical requirement as it serves to detect potentially fatalevents such as acute respiratory failure as well as pulmonary diseases.Existing methods to obtain patient data relating to respiratory functioninclude devices such as spirometers, chest-belts, impedance pneumographywhich are contact-based devices. Such devices can be associated withdiscomfort and psychological dependence. In many diagnosis andtherapeutic applications, it is desirable to know the precise intervalsof both inspiration and expiration phases of respiration for reasonswhich include: assessment and intervention prediction for asthmatic andpulmonary patients where the analysis is to be carried out during theexpiration phase; respiratory gated acquisition of radiological imageswhere the X-ray device is triggered at a pre-defined phase of therespiratory cycle; and respiratory gated therapeutic shock deliverysystems where acoustic shocks are delivered in-phase with therespiratory cycles.

Accordingly, what is needed in this art is a system and method forestimating respiratory phase from a video of a subject.

BRIEF SUMMARY

What is disclosed is a system and method for estimating respiratoryphase from a video of a subject for respiratory function assessment. Oneembodiment of the present method involves performing the following.First, a video of a subject is received. The video comprises imageframes of a region of the subject where a signal corresponding to thesubject's respiratory function can be registered by at least one imagingchannel of a video imaging device used to capture the video. Next, thepixels in the region in each of the image frames are processed toidentify a respiratory pattern which comprises a respiratory signal withtemporally successive peak/valley pairs. A peak/valley pair of interestis selected for which respiratory phase is desired to be determined. Anarray of optical flow vectors is determined between a window of pixellocations in a reference image frame which corresponds to the peak ofthe selected pair/valley pair and a similarly sized window in each of apre-defined number of image frames which correspond to the respiratorysignal occurring between the peak and ending at the valley point. Theoptical flow vectors have a direction corresponding to motion caused bytemporal variations in intensity and a magnitude corresponding to anamount of the variation. A ratio is determined between optical flowvectors having a upwardly pointing direction to optical flow vectorshaving a downwardly pointing direction. Based on the ratio, adetermination is made whether the respiration phase for the selectedpeak/valley pair is inspiration or expiration. Features and advantagesof the above-described method will become readily apparent from thefollowing detailed description and accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other features and advantages of the subject matterdisclosed herein will be made apparent from the following detaileddescription taken in conjunction with the accompanying drawings, inwhich:

FIG. 1 shows an anterior view of an adult human as well as a posteriorview;

FIG. 2 shows an example video imaging device capturing image frames of aregion of interest of the subject of FIG. 1;

FIG. 3 shows an example breathing pattern identified for the subject inFIG. 2 which is associated with normal breathing;

FIGS. 4 and 5 are images with optical flow vectors having been computedthereon;

FIG. 6 is a flow diagram which illustrates one embodiment of the presentmethod for respiratory phase estimation from a video of a subject;

FIG. 7 is a continuation of the flow diagram of FIG. 6 with flowprocessing continuing with respect to node A;

FIG. 8 shows a functional block diagram of one example video processingsystem 800 for processing a video in accordance with the embodimentsdescribed with respect to the flow diagrams of FIGS. 6-7; and

FIG. 9 shows a sample overlay between the pneumographic signal and thesignal generated using video and phase compensation.

DETAILED DESCRIPTION

What is disclosed is a system and method for estimating respiratoryphase defined as intervals of inspiration and expiration from a video ofa subject for respiratory function assessment.

It should be understood that one of skilled in this art would readilyunderstand various aspects of image processing, and methods forgenerating time-series signals from pixels obtained from batches ofimage frames in a video. One skilled in this art would also be readilyfamiliar with optical flow techniques and algorithms.

NON-LIMITING DEFINITIONS

A “subject” refers to a living being. Although the term “person” or“patient” may be used throughout this disclosure, it should beappreciated that the subject may be something other than a human suchas, for example, a primate. Therefore, the use of such terms is not tobe viewed as limiting the scope of the appended claims strictly to humanbeings with a respiratory function. FIG. 1 shows an anterior (frontal)view 101 of an adult human as well as a posterior (rear) view 102. Thesubject in the video can be any distance away from the medicalpractitioner with the video of the subject being communicated to aworkstation over a wired or wireless network.

“Respiratory function” is a process of inspiration of air into the lungs(inhalation) and expiration of air out of the lungs (exhalation)followed by a brief post-expiratory pause. The expansion and contractionof the lungs and chest walls induces a movement in the subject's bodywhich is captured in a video of the subject.

A “video”, as is generally understood, refers to a plurality oftime-sequential image frames captured of a region of a subject where asignal corresponding to respiratory function can be registered by atleast one imaging channel of the video imaging device used to capturethat video. The video may also contain other components such as, audio,time, date, reference signals, frame information, and the like.

A “video imaging device” refers to a video camera such as, for example,a color video camera, a monochrome video camera, an infrared videocamera, a multispectral video imaging device, a hyperspectral videocamera, and a hybrid device comprising any combination hereof. FIG. 2shows an example video imaging device 200 capturing image frames(individually at 201) of a region 103 of the subject of FIG. 1. Thevideo imaging device is shown having a communication element 202, shownas an antenna, which effectuates communication with a remote device suchas a workstation over a wireless network where the image frames arereceived for processing in accordance with the methods disclosed herein.The video imaging device may incorporate memory, a storage device, and avideo analysis module comprising one or more microprocessors forexecuting machine readable program instructions for processing thevideo. Such a video analysis module may comprise, in whole or in part, asoftware application working alone or in conjunction with one or morehardware resources. Software applications may be executed by processorson different hardware platforms or emulated in a virtual environment andmay leverage off-the-shelf software.

“Receiving a video” is intended to be widely construed and includesretrieving, capturing, acquiring, or otherwise obtaining video imageframes. The video can be received or retrieved from a remote device overa network, or from a media such as a CDROM or DVD. Video may bedownloaded from a web-based system or application which makes videoavailable for processing in accordance with the methods disclosedherein. Video can also be received from an application such as thosewhich are available for handheld cellular devices and processed on thecellphone or other handheld computing device such as an iPad orTablet-PC. The video can be received directly from a memory or storagedevice of the video imaging device used to capture that video.

A “region of the subject” refers to at least a partial view of thesubject as seen through the aperture of the video imaging device where arespiratory signal corresponding to respiratory function can beregistered by at least one imaging channel of the video imaging deviceused to capture that video. Regions which move during respirationinclude the thoracic region such as the chest and abdomen, and facialregions such as nostrils, lips, and cheeks. In FIG. 1, regions 103 and104 outline the subject's anterior thoracic region and posteriorthoracic region, respectively. Signals associated with respiratoryfunction can also be sensed by the video imaging device in a facialregion 105. The region may be an area of exposed skin or an area coveredby a sheet or an article of clothing. Regions can be identified in imageframes of the video by a user input or selection. For example, anoperator or technician may use a mouse or a touchscreen display to drawa rubber-band box around one or more areas of the video of the subjectdisplayed on a monitor thereby defining a region of pixels to beprocessed to obtain a respiratory pattern for the subject.

A “respiratory pattern” refers to a pattern of breathing. Respiratorypatterns include: Eupnea, Bradypnea, Tachypnea, Hypopnea, Apnea,Kussmaul, Cheyne-Stokes, Biot's, Ataxic, Apneustic, Agonal, andThoracoabdominal, as are understood in the medical arts. Methods fordetermining a respiratory pattern from a video are disclosed in:“Determining A Respiratory Pattern From A Video Of A Subject”, U.S.patent application Ser. No. 14/742,233, by Prathosh A. Prasad et al.,and “Breathing Pattern Identification For Respiratory FunctionAssessment”, U.S. patent application Ser. No. 14/044,043, by Lalit K.Mestha et al. FIG. 3 shows an example breathing pattern 300. Therespiratory pattern comprises a respiratory signal 301 which containstemporally successive peak/valley pairs.

A “peak/valley pair” refers to a peak in the respiratory signal and avalley point, as is widely understood in the signal processing arts. Afirst peak/valley pair is shown at 302 and 303, respectively. Methodsfor identifying or otherwise detecting a peak/valley pair in a signalinclude a manual selection by a user and the use of any of a wide arrayof automatic peak detection methods that are well established. Inaccordance with the methods disclosed herein, a peak/valley pair isprocessed along with corresponding image frames of the video of thesubject to generate optical flow vectors.

Introduction to Optical Flow

The concept of optical flow was introduced by James J. Gibson in the1940's to help understand and describe the role visual stimulus plays inthe perception of movement in the mind of an observer. Gibson postulatedthat sequences of ordered images allow the estimation of motion aseither instantaneous image velocities or discrete image displacements. Atutorial is disclosed in: “Handbook of Mathematical Models in ComputerVision”, Paragios et al., Springer (2006), ISBN-13: 978-0387263717,[See, chapter entitled: “Optical Flow Estimation”, by David J. Fleet andYair Weiss, which provides an introduction to gradient based opticalflow analysis].

Optical flow analysis tries to calculate motion between two image frameswhich are taken at times t and t+Δt at various pixel locations common toboth images or at locations of groups of pixels common to both images.These methods are often referred to as differential methods since theyare based on local Taylor series approximations, i.e., they use partialderivatives with respect to the spatial and temporal coordinates.

Generally, for a 2D+t dimensional case (3D or n-D cases are similar)values in the image at location (x,y,t) having intensity I(x,y,t) willhave moved an amount given by Δx, Δy and Δt between two image frames,such that:

I(x,y,t)=I(x+Δx,y+Δy,t+Δt)  (1)

Assuming the movement is small, the respective Taylor series can begiven as:

$\begin{matrix}{{I\left( {{x + {\Delta \; x}},{y + {\Delta \; y}},{t + {\Delta \; t}}} \right)} = {{I\left( {x,y,t} \right)} + {\frac{\partial I}{\partial x}\Delta \; x} + {\frac{\partial I}{\partial y}\Delta \; y} + {\frac{\partial I}{\partial t}\Delta \; t} + \ldots}} & (2)\end{matrix}$

From Eqs. (1) and (2), it follows that:

$\begin{matrix}{{{\frac{\partial I}{\partial x}\Delta \; x} + {\frac{\partial I}{\partial y}\Delta \; y} + {\frac{\partial I}{\partial t}\Delta \; t}} = 0} & (3)\end{matrix}$

which results in:

$\begin{matrix}{{{\frac{\partial I}{\partial x}V_{x}} + {\frac{\partial I}{\partial y}V_{y}} + {\frac{\partial I}{\partial t}V_{t}}} = 0} & (4)\end{matrix}$

where V_(x), V_(y) are the x and y components of the velocity or opticalflow of I(x,y,t) and

$\frac{\partial I}{\partial x},{\frac{\partial I}{\partial y}\mspace{14mu} {and}\mspace{14mu} \frac{\partial I}{\partial t}}$

are the derivatives of the image at (x,y,t) in the correspondingdirections.

Given the above, I_(x), I_(y) and I_(t) can be written for thederivatives. Thus:

I _(x) V _(x) +I _(y) V _(y) =−I _(t)  (5)

Alternatively,

∇I ^(T) ·{right arrow over (V)}=−I _(t)  (6)

Eq. (6) has two unknowns. This is known as the aperture problem ofoptical flow algorithms. To find the optical flow, another set ofequations is needed, given by some additional constraint. All opticalflow methods introduce additional conditions for estimating the actualflow. A result of having performed optical flow analysis on an image ora window within an image produces an array of optical flow vectors.

An “optical flow vector” is a vector, as is generally understood, havinga direction and a magnitude. In general, optical flow refers to apattern of apparent motion of an object in a scene caused by therelative motion between an observer (an eye or a camera) and the object.Example images 400 and 500 with optical flow vectors generated therefromare shown in FIGS. 4 and 5, respectively. The optical flow vectors areshown having been generated for pixels within windows 401 and 501,respectively.

Methods for optical flow analysis include: the Lucas-Kanade Method asdisclosed in: “An Iterative Image Registration Technique with anApplication to Stereo Vision”, Bruce D. Lucas and Takeo Kanade, Proc. ofImaging Understanding Workshop, pp. 121-130, (1981), the Horn-SchunckMethod as disclosed in: “Determining Optical Flow”, Berthold K. P. Hornand Brian G. Schunck, Vol 17, pp 185-203, Artificial Intelligence,(1981), and the Black-Jepson Method as disclosed in: “Computation ofOptical Flow”, S. S. Beauchemin, J. L. Barron, ACM Computing Surveys,Vol. 27, No. 3, (September 1995). It should also be appreciated thatdiscrete optimization methods can also be employed.

Other methods are discussed in: “A Database and Evaluation Methodologyfor Optical Flow”, Simon Baker, Daniel Scharstein, J. P. Lewis, StefanRoth, Michael J. Black, Richard Szeliski, International Journal ofComputer Vision, Vol. 92, pp. 1-31 (2011). It should be understood thatthe optical flow methods listed herein are representative and notexhaustive. Therefore the scope of the appended claims should not belimited to only these techniques.

“Respiratory phase”, as used herein, refers to either the inspirationphase of the respiratory signal (i.e., when air is being drawn into thelungs) or the expiration phase of the respiratory signal (i.e., when airis being expelled from the lungs) for a given peak/valley pair.Respiratory phase is determined by a ratio of optical flow vectors.

A “ratio of optical flow vectors” is determined between the number ofupwardly pointing optical flow vectors to the number of downwardlypointing optical flow vectors. Based on the ratio, the respiration phasefor the selected peak/valley pair is determined to be either inspirationor expiration. In one embodiment, if the ratio is above 1 then it isdetermined that the respiration phase of the selected peak/valley pairis at inspiration, and at expiration otherwise.

It should be appreciated that the method steps of: “receiving”,“isolating”, “extracting”, “processing”, “selecting”, “generating”,“determining”, “performing”, “filtering”, “locating”, “computing”, andthe like, include the application of any of a variety of signalprocessing techniques as are known in the signal processing wherein, inresponse to said ratio being higher than one, determining that therespiration phase of the selected peak/valley pair is inspiration, andexpiration otherwise arts, as well as a variety of mathematicaloperations according to any specific context or for any specificpurpose. It should be appreciated that such steps may be facilitated orotherwise effectuated by a microprocessor executing machine readableprogram instructions such that an intended functionality can beeffectively performed.

Example Flow Diagram

Reference is now being made to the flow diagram of FIG. 6 whichillustrates one embodiment of the present method for respiratory phaseestimation from a video of a subject. Flow processing begins at step 600and immediately proceeds to step 602.

At step 602, receive a video of a region of a subject where a signalcorresponding to respiratory function can be registered by at least oneimaging channel of a video imaging device used to capture that video.

At step 604, process pixels in the image frames to identify arespiratory pattern for the subject. The respiratory pattern comprises arespiratory signal with temporally successive peak/valley pairs. Anexample respiratory signal is shown in FIG. 3.

At step 606, select a peak/valley pair of interest for which respiratoryphase is desired to be determined. One exampled selected peak/valleypair is shown at 302 and 303 of FIG. 3.

At step 608, generate an array of optical flow vectors between a windowof pixel locations in a reference image frame corresponding to a peak ofthe selected pair/valley pair and a substantially same window of pixellocations in each of a pre-defined number of image frames correspondingto the respiratory signal between the peak and ending at a pre-selectedpoint in the valley. Images with optical flow vectors are shown in FIGS.4 and 5. As shown, the optical flow vectors have a directioncorresponding to motion caused by temporal variations in intensity and amagnitude corresponding to an amount of the variation.

Reference is now being made to the flow diagram of FIG. 7, which is acontinuation of the flow diagram of FIG. 6 with flow processingcontinuing with respect to node A.

At step 610, determine a ratio of optical flow vectors having an upwardpointing direction to optical flow vectors having a downward pointingdirection. Such a determination can be made either manually orautomatically using, for example, a processor executing machine readableprogramming instructions to perform this.

At step 612, determine, based on the ratio, that the respiration phasefor the selected peak/valley pair is one of: inspiration and expiration.

At step 614, communicate the determined respiration phase to a displaydevice. The result of the determination based on the ratio can also bestored to the storage device such as a memory or a hard drive.

At step 616, a determination is made whether to select anotherpeak/valley pair for respiration phase determination. If so, thenprocessing repeats with respect to node B wherein, at step 606, a nextpeak/valley pair of interest is selected for processing. Processingrepeats in a similar manner until no more peak/valley pairs are desiredto be selected. Thereafter, in this embodiment, further processingstops.

The flow diagrams depicted herein are illustrative. One or more of theoperations illustrated in the flow diagrams may be performed in adiffering order. Other operations may be added, modified, enhanced, orconsolidated. Variations thereof are intended to fall within the scopeof the appended claims.

Block Diagram of Video Processing System

Reference is now being made to FIG. 8 which shows a block diagram of oneexample video processing system 800 for processing a video in accordancewith the embodiments described with respect to the flow diagrams ofFIGS. 6-7.

Video Receiver 801 wirelessly receives the video via antenna 802 havingbeen transmitted thereto from the video imaging device 200 of FIG. 2using communication element 202. Respiratory Pattern Generator 803generates a respiratory pattern for the subject from the received videoof the subject. Peak/Valley Detector receives the generated respiratorypattern and proceeds to detect peak/valley pairs in the respiratorysignal. Results are communicated to storage device 805. Peak/ValleySelector Module 806 retrieves the stored peak/valley pairs and selects apeak/valley pair of interest for which respiratory phase is desired tobe determined. Peak/valley pairs of interest may also be selected by auser using, for instance, the keyboard, mouse and display device of theworkstation 820. Optical Flow Module 807 receives the selectedpeak/valley pair of interest and proceeds to generate optical flowvectors for image frames in the video corresponding to the selectedpeak/valley pair, in a manner as disclosed herein. Vector Counter 808receives the optical flow vectors for the processed images frames andproceeds to count the number of optical flow vectors having an upwardlypointing direction and the number of optical flow vectors having adownwardly pointing direction. Ratio Determinator 809 receives the countof upwardly and downwardly pointing optical vectors and proceeds todetermine whether the respiratory phase for the selected peak/valleypair is one of inspiration or expiration.

Central Processing Unit 810 retrieves machine readable programinstructions from a memory 811 and is provided to facilitate thefunctionality of any of the modules and processing units of the system800. CPU 810, operating alone or in conjunction with other processors,may be configured to assist or otherwise perform the functionality ofany of the modules or processing units of the system 800, as well asfacilitating communication between the video processing system 800 andthe workstation 820.

Workstation 820 is shown generally comprising a computer case whichhouses various components such as a motherboard with a microprocessorand memory, a network card, a video card, a hard drive capable ofreading/writing to machine readable media 822 such as a floppy disk,optical disk, CD-ROM, DVD, magnetic tape, and the like, and othersoftware and hardware as is needed to perform the functionality of acomputer workstation. The workstation includes a display device 823,such as a CRT, LCD, or touchscreen display, for displaying information,image frames, vector magnitudes, vector intensities, optical flowvectors, computed values, patient medical information, and the like,which are produced or are otherwise generated by any of the modules orprocessing units of the video processing system 800. A user can view anysuch information and make a selection from various menu optionsdisplayed thereon. Keyboard 824 and mouse 825 effectuate a user input orselection. It should be appreciated that the workstation has anoperating system and other specialized software configured to displayalphanumeric values, menus, scroll bars, dials, slideable bars,pull-down options, selectable buttons, and the like, for entering,selecting, modifying, and accepting information needed for performingvarious aspects of the methods disclosed herein.

A user may use the workstation to identify a set of image frames ofinterest, set various parameters, and other facilitate the functionalityof any of the modules or processing units of the video processing system800. A user or technician may utilize the workstation to selectpeak/valley pairs of interest, modify, add or delete vectors or move thewindow around or re-size the window as is deemed appropriate. The usermay adjust various parameters being utilized or dynamically adjust inreal-time, system or settings of any device used to capture the videoimages.

User inputs and selections may be stored/retrieved to/from any of thestorage devices 805, 822 and 826. Default settings and initialparameters can be retrieved from any of the storage devices. The system800 may communicate to one or more remote devices over network 828,utilizing a wired, wireless, or cellular communication protocol.Although shown as a desktop computer, it should be appreciated that theworkstation can be a laptop, mainframe, tablet, notebook, smartphone, ora special purpose computer such as an ASIC, or the like. The embodimentof the workstation is illustrative and may include other functionalityknown in the arts.

The workstation implements a database in storage device 826 whereinrecords are stored, manipulated, and retrieved in response to a query.Such records, in various embodiments, take the form of patient medicalhistory stored in association with information identifying the patient(collectively at 827). It should be appreciated that database 826 may bethe same as storage device 805 or, if separate devices, may contain someor all of the information contained in either device. Although thedatabase is shown as an external device, the database may be internal tothe workstation mounted, for example, on a hard drive.

Any of the components of the workstation may be placed in communicationwith any of the modules of system 800 or any devices placed incommunication therewith. Moreover, any of the modules of system 800 canbe placed in communication with storage device 826 and/or computerreadable media 822 and may store/retrieve therefrom data, variables,records, parameters, functions, and/or machine readable/executableprogram instructions, as needed to perform their intended functionality.Further, any of the modules or processing units of the system 800 may beplaced in communication with one or more remote devices over network828. It should be appreciated that some or all of the functionalityperformed by any of the modules or processing units of system 800 can beperformed, in whole or in part, by the workstation. The embodiment shownis illustrative and should not be viewed as limiting the scope of theappended claims strictly to that configuration. Various modules maydesignate one or more components which may, in turn, comprise softwareand/or hardware designed to perform the intended function.

Performance Results

Data was collected from five human subjects who were asked to breathe ina tidal breathing pattern while wearing an impedance pneumographicdevice which would generate the ground truth. Simultaneously, video wascaptured of the subjects. Once the data was collected, it was processedusing the methods hereof to generate their respective respiratorypatterns. For each subject, a few peak/valley pairs were identifiedrandomly. The Lucas-Kanade Algorithm was used for differential opticalflow computation. The evaluation metric was the percentage of cyclescorrectly determined by the present method as compared to the groundtruth. The results are shown in FIG. 9 which is a sample overlay betweenthe pneumographic signal and the signal generated using video and phasecompensation. The expiration cycle is the interval between lines 1001and 1002 and the inspiration cycle is the interval between lines 1003and 1002. FIG. 9 demonstrates that the present method accuratelyidentifies respiratory phases from a video of the subject.

Various Embodiments

The teachings hereof can be implemented in hardware or software usingany known or later developed systems, structures, devices, and/orsoftware by those skilled in the applicable arts without undueexperimentation from the functional description provided herein with ageneral knowledge of the relevant arts. One or more aspects of themethods described herein are intended to be incorporated in an articleof manufacture. The article of manufacture may be shipped, sold, leased,or otherwise provided separately either alone or as part of a productsuite or a service.

The above-disclosed and other features and functions, or alternativesthereof, may be desirably combined into other different systems orapplications. Presently unforeseen or unanticipated alternatives,modifications, variations, or improvements may become apparent and/orsubsequently made by those skilled in this art which are also intendedto be encompassed by the following claims. The teachings of anypublications referenced herein are hereby incorporated in their entiretyby reference being made thereto.

What is claimed is:
 1. A computer implemented method for respiratoryphase estimation from a video of a subject for respiratory functionassessment, the method comprising: receiving a video of a subject, saidvideo comprising image frames of a region of said subject where a signalcorresponding to said subject's respiratory function can be registeredby at least one imaging channel of a video imaging device used tocapture said video; processing pixels in said image frames to identify arespiratory pattern for said subject, said respiratory patterncomprising a respiratory signal with temporally successive peak/valleypairs; selecting a peak/valley pair of interest for which respiratoryphase is desired to be determined; generating an array of optical flowvectors between a window of pixel locations in a reference image framecorresponding to a peak of said selected pair/valley pair and asubstantially same window of pixel locations in each of a pre-definednumber of image frames corresponding to said respiratory signal betweensaid peak and ending at a pre-selected point in said valley, saidoptical flow vectors having a direction corresponding to motion causedby temporal variations in intensity and a magnitude corresponding to anamount of said variation; determining a ratio of optical flow vectorshaving an upward pointing direction to optical flow vectors having adownward pointing direction; and determining, based on said ratio, thatsaid respiration phase for said selected peak/valley pair is one of:inspiration and expiration.
 2. The method of claim 1, wherein said videoimaging device is any of: a color video camera, an infrared videocamera, a monochrome video camera, a multispectral video imaging device,a hyperspectral video camera, and a hybrid device comprising anycombination hereof.
 3. The method of claim 1, wherein, in advance ofdetermining said ratio, pre-selecting only those optical flow vectorswhich have a magnitude that exceeds a pre-defined threshold.
 4. Themethod of claim 1, wherein identifying said peak/valley pairs comprises:filtering said respiratory signal with a moving average filter to obtaina smoothed signal; computing a derivative of said smoothed signal; andlocating positive and negative zero-crossings in said derivativecorresponding to peaks and valleys.
 5. The method of claim 1, whereinidentifying said peak/valley pairs is performed by one of: a manualselection method and an automatic peak detection method.
 6. The methodof claim 1, wherein said window has a size that is at least equal tohalf a size of an image frame.
 7. The method of claim 1, wherein saidoptical flow vectors are generated between a pairs of frames with agiven frame corresponding to a peak as said reference frame.
 8. Themethod of claim 1, wherein generating said optical flow vectors utilizesa method comprising any of: a Lucas-Kanade, a Horn-Schunck, and aBlack-Jepson method.
 9. The method of claim 8, further comprisingaggregating said resolved optical flow vectors using one of: a maximumvote, and a mean value metric.
 10. The method of claim 1, wherein, inresponse to said ratio being higher than one, determining that saidrespiration phase of said selected peak/valley pair is inspiration, andexpiration otherwise.
 11. A system for respiratory phase estimation froma video of a subject for respiratory function assessment, the systemcomprising: a processor in communication with a memory, the processorexecuting machine readable instructions for performing the steps of:receiving a video of a subject, said video comprising image frames of aregion of said subject where a signal corresponding to said subject'srespiratory function can be registered by at least one imaging channelof a video imaging device used to capture said video; processing pixelsin said image frames to identify a respiratory pattern for said subject,said respiratory pattern comprising a respiratory signal with temporallysuccessive peak/valley pairs; selecting a peak/valley pair of interestfor which respiratory phase is desired to be determined; generating anarray of optical flow vectors between a window of pixel locations in areference image frame corresponding to a peak of said selectedpair/valley pair and a substantially same window of pixel locations ineach of a pre-defined number of image frames corresponding to saidrespiratory signal between said peak and ending at a pre-selected pointin said valley, said optical flow vectors having a directioncorresponding to motion caused by temporal variations in intensity and amagnitude corresponding to an amount of said variation; determining aratio of optical flow vectors having an upward pointing direction tooptical flow vectors having a downward pointing direction; determining,based on said ratio, that said respiration phase for said selectedpeak/valley pair is one of: inspiration and expiration; and storing aresult of said determination based on said ratio to said memory.
 12. Thesystem of claim 10, wherein said video imaging device is any of: a colorvideo camera, an infrared video camera, a monochrome video camera, amultispectral video imaging device, a hyperspectral video camera, and ahybrid device comprising any combination hereof.
 13. The system of claim10, wherein, in advance of determining said ratio, pre-selecting onlythose optical flow vectors which have a magnitude that exceeds apre-defined threshold.
 14. The system of claim 10, wherein identifyingsaid peak/valley pairs comprises: filtering said respiratory signal witha moving average filter to obtain a smoothed signal; computing aderivative of said smoothed signal; and locating positive and negativezero-crossings in said derivative corresponding to peaks and valleys.15. The system of claim 10, wherein identifying said peak/valley pairsis performed by one of: a manual selection method and an automatic peakdetection method.
 16. The system of claim 10, wherein said window has asize that is at least equal to half a size of an image frame.
 17. Thesystem of claim 10, wherein said optical flow vectors are generatedbetween a pairs of frames with a given frame corresponding to a peak assaid reference frame.
 18. The system of claim 10, wherein generatingsaid optical flow vectors utilizes a method comprising any of: aLucas-Kanade, a Horn-Schunck, and a Black-Jepson method.
 19. The systemof claim 20, further comprising aggregating said resolved optical flowvectors using one of: a maximum vote, and a mean value metric.
 20. Thesystem of claim 10, wherein, in response to said ratio being higher thanone, determining that said respiration phase of said selectedpeak/valley pair is inspiration, and expiration otherwise.